package com.restaurant.springboot.service;

import com.restaurant.springboot.entity.CouponEntity;

import java.beans.Transient;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

public interface CouponService {
    //通过userId获取所拥有的优惠券
    List<Map<String, Object>> getAllCouponByUserId(int userId);

    //使用优惠券
    @Transient
    boolean useCoupon(int userId, int couponSeriesId);

    //领取优惠券
    @Transient
    boolean takeCoupon(int userId, int couponSeriesId, Timestamp receiveTime);

    //判断优惠券是否存在
    boolean isExistsCoupon(int userId, int couponSeriesId);

    //删除优惠券
    void deleteCoupon(int userId, int couponSeriesId);
    //获取优惠券
    CouponEntity getCoupon(int userId, int couponSeriesId);
    //修改优惠券，目前只用于重复领取
    boolean updateCoupon(CouponEntity couponEntity);
    //取消订单返回优惠券
    boolean cancelOrderReturnCoupon(int userId,int couponSeriesId);
}
